<!DOCTYPE html>
<html>

<body>
    <h1>演示如何访问输入按钮</h1>
    <p>触发button</p>
    <input type="button" id="access_url" onclick="access_url()" value="access_url 访问其它网页" />

    <script>
        function access_url() {
            var url = window.location.host;
            console.log(url+"++");

            var new_url = url + "/index.html"
            console.log(new_url+"--");
            <!-- window.location.replace(new_url) -->
        }
    </script>
</body>

</html>